# Maintainer: Luca Weiss <luca@z3ntu.xyz>
pkgname=umockdev
pkgver=0.17.18
pkgrel=0
pkgdesc="Mock hardware devices for creating unit tests and bug reporting"
arch="all"
url="https://github.com/martinpitt/umockdev"
license="LGPL-2.1-or-later"
makedepends="eudev-dev gtk-doc meson vala libpcap-dev gobject-introspection-dev"
checkdepends="gphoto2 libgudev-dev py3-gobject3 usbutils xz"
if [ "$CARCH" != "ppc64le" ]; then
	checkdepends="$checkdepends evtest"
fi
options="!check" # fail on builders for some reason, works on CI and locally (and for upstream)
source="https://github.com/martinpitt/umockdev/releases/download/$pkgver/umockdev-$pkgver.tar.xz"
subpackages="$pkgname-dev $pkgname-doc"

build() {
	abuild-meson \
		-Dgtk_doc=true \
		. output
	meson compile -C output
}

check() {
	meson test --no-rebuild --print-errorlogs -C output
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output
}

sha512sums="
3d8d2487b4350e4ce28a5c163cbb1b92da9f5a5317e74da46ccaa62a6b8e938a6758e241d0dd2e9f50fdee4aef24d36585a24cfec1ad99fb4799a01008d9987b  umockdev-0.17.18.tar.xz
"
